#include "gf_server.h"
#include "data.h"
#include "Log.h"

int gf_extract_server::start(){
	string name = "gf_extact";
	string ip = "199.155.122.11";
	int port = 44501;
	set_name(name);
	set_ip(ip);
	set_port(port);

	name = "gf_match";
	ip = "199.155.122.11";
	port = 44504;
	server *match_server = new server(name,ip,port);
	add_match_server(match_server);

	LOG_INFO_VA("[%s] server start", get_name().c_str());
	server::start();

	return 0;
}

int gf_match_server::start(){
	string name = "gf_match";
	string ip = "199.155.122.11";
	int port = 44501;
	set_name(name);
	set_ip(ip);
	set_port(port);

	database_bdb *db = new database_bdb;
	set_database(db);

	std::string data_path = "/home/murphy/coderoot/projects/v-search/trunk/data/db/";
	LOG_INFO_VA("[%s] data_path: %s",get_name().c_str(),data_path.c_str());
	get_database()->set_data_root_path(data_path);
	
	LOG_INFO_VA("[%s] server start", get_name().c_str());
	server::start();

	return 0;
}




